#!/usr/bin/env python

from _manga import Manga

class Chapter(Manga):
    '''Chapter class
    
    @author Julot <andy.julot@gmail.com>
    @since Tuesday, May 08, 2012. 07:57 PM'''
    
    _values = None
    
    @property
    def values(self):
        return self._values
    
    @values.setter
    def values(self, values):
        self._values = values
        self._value = None
        self.Clear()
        for value in values:
            sequence = value['sequence']
            subSequence = value['subSequence']
            title = value['title']
            if sequence and title:
                chapter = '%s%s. %s' % (sequence, subSequence, title)
            elif sequence:
                chapter = 'Chapter %s%s' %  (sequence, subSequence)
            else:
                chapter = title
            self.Append(chapter)
